Fix reset, add undo, exit gracefully