Fix focus issues on the MessageDialog

Fixes #772