Some clumsy parsing of header record