Fix #14: Exit with message and code on config errors

First attempt at this issue --
Check for the configuration error and exit in the same function.
Alternative we can consider is to return None, or raise some form of ValueException, so the responsibility lies on the calling function to check and print error messages.