Re #8979. Protecting against non-string types in the dict.