Correct subtle bugs with modal dialogs; use a standard 'is_valid' flag to detect user OK + properly set params