Config file parsing and misc. improvements