Moved test for existing names to more correct location