 				// Current simulation timestep
 				current_time_in_seconds = float(timestep_index)*float(timestep);
 				// Start by resetting all the things
-				CudaSafeCall(cudaMemset(currentinjection, 0.0f, total_number_of_neurons*sizeof(float)));	
+				CudaSafeCall(cudaMemset(currentinjection, 0.0f, neurons->total_number_of_neurons*sizeof(float)));	
 				// If there are poisson populations
 				if (numPoisson > 0) {
 					// First create the set of random numbers of poisson neurons
-					randoms<<<vectorblocksPerGrid, threadsPerBlock>>>(states, gpu_randfloats, total_number_of_neurons);
+					randoms<<<vectorblocksPerGrid, threadsPerBlock>>>(states, gpu_randfloats, neurons->total_number_of_neurons);
 					CudaCheckError();
 
 					// Update Poisson neuron states


	delete neurons;
	delete connections;

	CudaSafeCall(cudaFree(states));
	CudaSafeCall(cudaFree(gpu_randfloats));

	// RANDOM NUMBERS
	// Create the random state seed trackers
	curandState_t* states;
	cudaMalloc((void**) &states, neurons->total_number_of_neurons*sizeof(curandState_t));
	// Initialise the random states
	init<<<threadsPerBlock, vectorblocksPerGrid>>>(42, states, neurons->total_number_of_neurons);
	CudaCheckError();
	// Keep space for the random numbers
	float* gpu_randfloats;
	CudaSafeCall(cudaMalloc((void**) &gpu_randfloats, neurons->total_number_of_neurons*sizeof(float)));
	// REQUIRED DATA SPACES
	float* currentinjection;
	CudaSafeCall(cudaMalloc((void**)&currentinjection, neurons->total_number_of_neurons*sizeof(float)));
	// Variables necessary
	clock_t begin = clock();

	// Poisson number
	int numPoisson = 0;
	for (int i = 0; i < neurons->total_number_of_neurons; i++){
		if (neurons->neuron_variables[i].rate != 0.0f){
			++numPoisson;
		}
