Reviewer: None - Improve code coverage, stabilize build

Improve code coverage of UTs and add a coverage exclusion for the new `custom_headers.cpp` file.  Also fixes an issue where header parameters are lost if a `print_on()` call fails.