Undo/Erase bugs fixed