Correct some bug in config handling