Bug fixes for certain PHP versions