Some fixes for the PHP backend