Repo import 4.1 fix (empty repositories)

Fix for #2830
Includes fix from #2695

Import all repos to global namespace, otherwise the new generated repositories are empty!