Fix name resolution for imported packages