     size_t bytes_per_thread = sizeof(double)*(5*meqn+3*maux+mwaves+meqn*mwaves);
     
     double* maxcflblocks_dev;
-    cudaMalloc(&maxcflblocks_dev,batch_size*sizeof(double)); 
+    CHECK(cudaMalloc(&maxcflblocks_dev,batch_size*sizeof(double))); 
     cudaclaw_flux2_and_update_batch<<<grid,block,128*bytes_per_thread >>>(mx,my,meqn,
                                                                      mbc,maux,mwaves,dt,t,
                                                                      array_fluxes_struct_dev,

    int maux = clawpatch_opt->maux;
    int meqn = clawpatch_opt->meqn;  

    /* ---------------------------------- Merge Memory ---------------------------------*/ 
    cudaclaw_fluxes_t* fluxes = &(array_fluxes_struct[0]);
    size_t size = batch_size*(fluxes->num + fluxes->num_aux);
    size_t bytes = size*sizeof(double);
    double *membuffer;
    //double *membuffer = FCLAW_ALLOC(double,size);
    CHECK(cudaMallocHost((void**)&membuffer,bytes));

    double* membuffer_dev;
    CHECK(cudaMalloc((void**)&membuffer_dev, bytes));

    for(i = 0; i < batch_size; i++)   
    {
        cudaclaw_fluxes_t* fluxes = &(array_fluxes_struct[i]);    

        int I_q = i*fluxes->num;
        int I_aux = batch_size*fluxes->num + i*fluxes->num_aux;

        memcpy(&membuffer[I_q]  ,fluxes->qold ,fluxes->num_bytes);
        memcpy(&membuffer[I_aux],fluxes->aux  ,fluxes->num_bytes_aux);

        /* Assign gpu pointers */
        fluxes->qold_dev = &membuffer_dev[I_q];
        fluxes->aux_dev  = &membuffer_dev[I_aux];
    }        

    CHECK(cudaMemcpy(membuffer_dev, membuffer, bytes, cudaMemcpyHostToDevice));

    /* -------------------------------- Work with array --------------------------------*/ 


	
    /* -------------------------------- Finish CFL ------------------------------------*/ 
    {
        PROFILE_CUDA_GROUP("Finish CFL",1);
        void    *temp_storage_dev = NULL;
        size_t  temp_storage_bytes = 0;
        double  *cflgrid_dev;
