PIM-1518 : fix write counter to manage the with/without header case