Fix behavior when clicking 'cancel'.