Small fixes to undo buffer.