Fix alias resolution and module name id mapping