Corrections for PHP5.4 compliance