Fix "Cancel" buttons on modal dialogs

An earlier patch broke the cancel buttons on modal dialogs. This one
unbreaks them.