Fix BasicVisitor to pass tests