fixed seg faults on error
- several bug fixes within the template system
- fixed bugs concerning error handling on startup
- fixed bugs concerning the commandline