maps

this PR just merges already-PRed code (#1051 and #1104) from a 'purgatory' branch into master.