Fix bug in NameVisitor