fixed some PHP 5.3 issues