fix Leaflet not saving base layer properly
add sanity checks to lat/lng to avoid issues like #153 (fixes #153)