Fixed PHP Illegal Offset errors on the headers