Dialog focus

This PR fixes the issue detailed in #143.