Minor fixes to the dialog and perf improvements