Config file parser

Fix logic errors