Added workaround for PHP bug https://bugs.php.net/64137