 	BF_ASSERT(plan, BF_STATUS_INVALID_HANDLE);
 	BF_ASSERT(in,   BF_STATUS_INVALID_POINTER);
 	BF_ASSERT(out,  BF_STATUS_INVALID_POINTER);
-	BF_ASSERT( in->shape[ in->ndim-3] == plan->ntime(),  BF_STATUS_INVALID_SHAPE);
-	BF_ASSERT( in->shape[ in->ndim-2] == plan->nstand(), BF_STATUS_INVALID_SHAPE);
-	BF_ASSERT( in->shape[ in->ndim-1] == 2,              BF_STATUS_INVALID_SHAPE);
+	BF_ASSERT( in->shape[ in->ndim-3] == plan->ntime(),      BF_STATUS_INVALID_SHAPE);
+	BF_ASSERT( in->shape[ in->ndim-2] == plan->nstand(),     BF_STATUS_INVALID_SHAPE);
+	BF_ASSERT( in->shape[ in->ndim-1] == 2,                  BF_STATUS_INVALID_SHAPE);
+	BF_ASSERT( in->shape[ in->ndim-3] %  plan->decim() == 0, BF_STATUS_INVALID_SHAPE);
 	BF_ASSERT( out->shape[out->ndim-3] == in->shape[in->ndim-3]/plan->decim(), BF_STATUS_INVALID_SHAPE);
 	BF_ASSERT( out->shape[out->ndim-2] == in->shape[in->ndim-2],               BF_STATUS_INVALID_SHAPE);
 	BF_ASSERT( out->shape[out->ndim-1] == in->shape[in->ndim-1],               BF_STATUS_INVALID_SHAPE);

				}
				d_out[t0/decim*nstand*2 + s*2 + p] = tempO;
				
				c = ncoeff - (ntime - t0);
				if( c >= 0 && c < ncoeff ) {
					// Seed the initial state of the next call
					state1[c*nstand*2 + s*2 + p] = Complex64(d_in[t0*nstand*2*2 + s*2*2 + p*2 + 0], \
					                                         d_in[t0*nstand*2*2 + s*2*2 + p*2 + 1]);
				}
			}
		}

	ntime *= decim;
	
	dim3 grid(first, secnd);
	/*
	cout << "  Block size is " << block.x << " by " << block.y << endl;
	cout << "  Grid  size is " << grid.x << " by " << grid.y << endl;
	cout << "  Maximum size is " << block.x*grid.x*grid.y << endl;
	if( block.x*grid.x*grid.y >= ntime ) {
		cout << "  -> Valid" << endl;
	}
	*/
	
	void* args[] = {&ncoeff,
	                &decim,
