Fix bugs in computeMean and renderView