Making changes so compatible down to PHP 5.2