Fix a bug where multiple imports were causing incorrect behaviour when a hidden name was looked up.