Fixed a bug with directory dialog.