Fixed some PHP5.3 incompatibilities