Fixed bug with missing or wrong header