Fixed stupid mistake leading to KeyError