adjusting group by and other values to correct small mistakes