Import: Fix bugs with import on large program sets