Where is this `KeyError` being thrown? Seems like this try block might be too large.