Fixed header writting and checks