Fixed bug in dialog code.