Detect and inform of inconsistencies in operation tracking.

Before compression, each sequence of operations is checked for
correctness.