PHP 5.4/5.5 fixes