 			    ceil((float)image_height / block_dim.y) );
       avg_filter_2D<<<grid_dim,block_dim>>>(old_image_G, new_image_G);
     }
-    else if (mode == 5) {
+    else if (mode == 4) {
       dim3 block_dim = dim3(32, 32);
       dim3 grid_dim = dim3( ceil((float)image_width / 30),
 			    ceil((float)image_height / 30) );


  ///////////////////////////// Clean up and exit: /////////////////////////////

  if (mode != 4) {
    free(new_image);
  }
  else if (mode == 4) {
    checkCudaErrors( cudaFreeHost(new_image) );
  }
  if (mode > 1) {


  if ((mode == 2) || 
      (mode == 3) || 
      (mode == 4)) { ///////////////// Non-streaming examples //////////////////

    // Copy input image to GPU:
    checkCudaErrors(  cudaMemcpy( old_image_G,
