 
 	// Allocate device arrays
 
-	double* dT;
-	double* dP;
-	double *dVV;
-	double *dVVOut;
-
-	unsigned char* dTPacked;
-	unsigned char* dPPacked;
-	unsigned char* dVVPacked;
-
-	int *dMissingValuesCount;
+	double* dT = NULL;
+	double* dP = NULL;
+	double* dVV = NULL;
+	double* dVVOut = NULL;
+
+	unsigned char* dTPacked = NULL;
+	unsigned char* dPPacked = NULL;
+	unsigned char* dVVPacked = NULL;
+
+	int *dMissingValuesCount = NULL;
 
 	CUDA_CHECK(cudaMalloc((void **) &dMissingValuesCount, sizeof(int)));
 	CUDA_CHECK(cudaMalloc((void **) &dT, memSize));

{

	int idx = blockIdx.x * blockDim.x + threadIdx.x;

	if (idx < opts.N)
	{
		if (opts.simplePackedT.HasData())


	if (!opts.isConstantPressure)
	{
		CUDA_CHECK(cudaMalloc((void **) &dP, memSize));

		if (opts.simplePackedP.HasData())
		{
			CUDA_CHECK(cudaMalloc((void **) &dPPacked, opts.simplePackedP.dataLength * sizeof(unsigned char)));
