Improve MySQL 5.1 compatibility