Fixed leaflet views default options.
Added javascript sanity checks.