Remove dependency on imported module data when generating names

When generating a name, use the current module's data rather than data coming from imported modules.