Small optimization of dialog_form()