- code formatting
- fix dialogs
- minor template changes
- add debug flag