Inverted this logic.
Stop adding to the header table unnecessarily.
Start maintaining the reference set.
I expect this to fail.
Move to lists of tuples for repro reasons