Couple of issues: - Fist/last frame calculation was wrong - Keyframe selection might silently fail leading to unpredictable math errors all over the place. Now if keyframe selection fails solver wouldn't run.
This way maintaining the C-API is a bit less tedious job and makes code cleaner to follow. Should be no functional changes.