Various changes 

* Better error handling
* Debug message corrected
* Removed code-duplication in ConfigurationParser