Fix header reading