fix some bugs with updating cells.