diff --git a/phase_correction.cu b/phase_correction.cu
index 4c26890ccb8f1e1205e0a5eb97f7dba8eda06463..64e47baa6f292b0dc2d1de7bcc8e9ff7dc524cf9 100644
--- a/phase_correction.cu
+++ b/phase_correction.cu
@@ -26,7 +26,7 @@ __global__ void phase_g(int xaxis,
 	double add_term_real;
 	double add_term_img;
 	double wterm;
-	long arraysize = (long)((xaxis*yaxis*num_w_planes)/nbucket + 1);
+	long arraysize = (long)((xaxis*yaxis*num_w_planes)/nbucket);
 
 	if(gid < arraysize)
 	{
@@ -95,7 +95,8 @@ void phase_correction(double* gridss, double* image_real, double* image_imag, in
 
 #ifdef __CUDACC__
 
-	int nbucket = 32;
+	// WARNING: nbucket MUST be chosen such that xaxis*yaxis*num_w_planes is a multiple of nbucket
+	int nbucket = 1;
         int Nth = NTHREADS;
         long Nbl = (long)((num_w_planes*xaxis*yaxis)/Nth/nbucket) + 1;
         if(NWORKERS == 1) {Nbl = 1; Nth = 1;};