Fix up undo

some cleanups