Fix dialog cancel behavior.