Two fixes. First, stop using the ugly shouldSubstituteIndVar method.