Improve previous fix to take into account different error numbers.