Fixed some edge cases for proper header test case