Bad dict value caused keyerrors