Recalculate mock mask generation for integration tests.
Update loop variable usage to match semantics.