Key errors fixed