Separated dialogs to own file, loads of bug fixes