Replaced ScopedMap::erase with a version that should avoid the order of declaration problems and also better reflects how it is actually used.