The large-work fork warning system is broken under header first validation. This should fix it by storing all valid headers, even if the block contents or the previous blocks are invalid.
It also stores invalid-version-but-otherwise-valid headers. This allows a potential planned hardfork to be followed by the client (a simplified version of the hardfork bit and hardfork warning system I proposed: https://github.com/bitcoin/bips/pull/317 and https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2016-December/013332.html )