Fixed Errors in the UnitVisitor class