Before this commit, there were situations where the reference numbers were not properly set, which caused the blocks generated to crash because the algorithm could not get correct references.