Some API extensions for Leaflet compatibility + related fixes/improvements