Dialogs functions, some fixes