Fix config loading bug, improve logging