Fix TryMax exit condition, close #1257