Fixed some implicityly declared variables and spelling issues