Fix php errors. closes #2451