Fix: Correct handling of invalid retry code