Fix bug in Dialog.