Added missing scope handling in the module reference search.