Fixed PHP5.3 deprecated errors