Bug when redrawing after an undo