Fix motion path effect when sampling at end of interval.

The first two changes aren't strictly necessary and are just sanity
checks.