Fixing KeyError.