Improved dialog focus handling slightly