Better content header error and slight refactor of test helper