Test for existence of headers before looping over them