 
     // Create dst bitmap image (empty for now)
     *dst_bitmap = createBitmap((*src_bitmap)->width, (*src_bitmap)->height, (*src_bitmap)->depth);
-    assert(*dst_bitmap != NULL && "Error: could not allocate memory for dst_bitmap");
+    assert((*dst_bitmap != NULL) && "Error: could not allocate memory for dst_bitmap");
 
     printf("image information\n");
     printf("=================\n");

// Pads the binary image given as input with the padding values provided as
// input. The padding value must be a binary white (0) or black (1).
void pad_binary_bitmap(Bitmap** image, uint8_t binary_padding_value, Padding padding) {
    assert(*image && "Error: Bitmap must be non-NULL");
    assert(is_binary_image(*image) && "Error: Must supply a binary image as input: only black (1) and white (0) are allowed");
    assert((binary_padding_value == BINARY_BLACK || binary_padding_value == BINARY_WHITE) && "Error: Must provide a binary value for padding");


    // Dimensions of computing elements on the CUDA device.
    int block_dim_x = strtol(block_dim_x_string, NULL, 10);
    int block_dim_y = strtol(block_dim_y_string, NULL, 10);
    assert(((block_dim_x * block_dim_y) <= cuda_device_properties.maxThreadsPerBlock) && "Error: Using more threads than permitted by maxThreadsPerBlock");
    assert((((block_dim_x * block_dim_y) % cuda_device_properties.warpSize) == 0) && "Error: Must use thread count which is a multiple of warpSize");

    int grid_dim_x = (int) ceil(((*src_bitmap)->width) / ((double) block_dim_x));
    int grid_dim_y = (int) ceil(((*src_bitmap)->height)/ ((double) block_dim_y));
