Better logging, fixed config.cfg handling