some BS fixes to make undo/redo work