Fixed some bugs in configs handling.