Fixed errors introduced by variable name changes