Fixed bug in Dialog.