Improve compatibility with PHP5.3