Fixes adding and updating grades in the grid