Fix cache invalidation bug.

Computation status cache invalidations propagated from an ancestors
whose scope is a subspace of the computation's scope could, depending on
the order of the dimensions, crash due to incorrect iteration.