Only apply angle thesholding if the leg is at an extremum, see #63