Fix histogram and update LensModel to support querying for magic keys.