 	//cudaErrorCheck(cudaSetDeviceFlags(cudaDeviceMapHost | cudaDeviceLmemResizeToMax));
 	int deviceId = gpuGetMaxGflopsDeviceId();
 	cudaErrorCheck(cudaSetDevice(deviceId));
-	cudaErrorCheck(cudaDeviceSetLimit(cudaLimitStackSize, 1024*5));
+	cudaErrorCheck(cudaDeviceSetLimit(cudaLimitStackSize, 1024*8));
 	_deviceHeap = cudaDeviceHeapCreate(256, 4096);
 	cudaErrorCheck(cudaDeviceHeapSelect(_deviceHeap));
 	//
-	D_DATA(&_data); d_MainInit_0<<<1,1>>>(_data.D_); H_DATA(&_data);
+	D_DATA(&_data); d_MainInit_0<<<1,1>>>(_data.D_); cudaErrorCheck(cudaDeviceHeapSynchronize(_deviceHeap)); H_DATA(&_data);
 	cudaDeviceHeapSynchronize(_deviceHeap);
 #else
 	SysEx::Config(SysEx::CONFIG_URI, 1);

// Initialize the state information in data
struct CallbackData _data;
#if __CUDACC__
cudaDeviceHeap _deviceHeap;
__global__ void d_MainInit_0(struct CallbackData *data)
{
	SysEx::Config(SysEx::CONFIG_URI, 1);

}
#endif

#define _lineSpacerLength 93
__device__ char *_lineSpacer = "---------------------------------------------------------------------------------------------";
__device__ static bool ShellCallback(void *arg, int colLength, char **colValues, char **colNames, int *colTypes)
{
	int i;
