Stop some potential NPEs

Also reinstate the dialog's modality as per pre-lambda changes.