Fixed PHP-981: Empty document should not throw exception