PHP 5.3 and MySQL 5.5 compatibility fixes