Minor optimization for non-mutable mappings dict
Correct cast when getting from cache
Less mutable state, more efficient override