Add compatability with PHP <= 5.2