Resolve KeyError

reported by @signalpillar