Backport cleaned up Map from 2.1 branch