Take ranges into account.
Added use candidate rule for nested resolve.
Fixed reads for changed import targets.