Fix 'Cancel' button functionality.