Fixed some undo stuff