Fixes bug with DM E2E waiting condition

There was a bug that didn't properly check the extents of a dataset
while looking for an escape condition for a loop, in some circumstances
the loop would not escape.