Protected against cyclic block references

When parsing block refs, errors will be set if a block contains a
reference to a block with lower or same id.