Properly cancel on esc, and save on blur