Correct return code if error