Fix Curve.getParameterAt() for negative values of offset, and implement unit test.

Closes #524.