Fix preview cancelling.
Fix undo step saving on Linux.