Fixed PHP infinite loop error.