Solved some bugs in the NameResolver