Corrected a bug with mean color