Fix regression in support for joins defined inside imported modules.

Introduced in e7a45be48369ccbbfdca1578f373ed8aa3c3994d. Fix #306.