Changes to allow compilation with PHP5.4