Made some changes on the cfg and map management