Fix 64 bit header writing