Fix reply management in case of error (depends on PHP version)