Add in new tests looking at header sequences
fix bugs caused by reference vs pointer

was assigning new values to a reference which of course was
then changing the underlying data - what I wanted was to change
what the data was pointing to.