bugs fixed for single_demosaic.m