Fix some stuff

Fixed config loader, added debug log, changed some code style