Why is this now a KeyError?