PROV-595 Fix for indexing issues introduced by optimization