 
         if (inBlock)
         {
-            calculateAndStoreErrorsInBlock(iii-1, blockStartIndex, fractionalErrors);
+            calculateAndStoreErrorsInBlock(iii-1, blockStartIndex, errorArray, fractionalErrors);
         }
     }
 };

                {
                    fractionalErrors[iii] = (double) errorArray[iii];
                } else {
                    calculateAndStoreErrorsInBlock(iii, blockStartIndex, fractionalErrors);
                    inBlock = false; // reset state variables
                    blockStartIndex = BLOCK_START_UNSET;
                }

// implements GATK's BaseRecalibrator.calculateFractionalErrorArray
struct compute_fractional_errors : public bqsr_lambda
{
    D_PackedVector_1b::const_view error_vector;
    D_VectorF64::view output_vector;

    compute_fractional_errors(bqsr_context::view ctx,
                              const alignment_batch_device::const_view batch,
                              const D_PackedVector_1b::const_view error_vector,
                              D_VectorF64::view output_vector)
        : bqsr_lambda(ctx, batch), error_vector(error_vector), output_vector(output_vector)
    { }

    CUDA_HOST_DEVICE void calculateAndStoreErrorsInBlock(const int iii,
                                                         const int blockStartIndex,
                                                         const D_PackedVector_1b::const_view errorArray,
                                                         double *fractionalErrors)
    {
        int totalErrors = 0;
