misc changes and fixed bug with map