fix up some unit tests, make sure valid work bits are used for headers for chaining, track invalid blocks