Fix bug preventing header from being written in log()