Enabled default document, fixed toggle basemap

Also some minro code cleanup