Preventing the escape key from closing dialog, minor logging cleanup.