Fixed some bugs in configuration reading.
Still fails when config not present