Many corrections to map.js, see tickets closed on 1/4/2013