Fix the extraction of module names to correctly qualify them.