Added a config file + bug fixes

- added scanConfigFile()
- added basic error messages