Fixed some variable inconsistencies