Fixes undo