Several bug fixes - initialization of dialogs