Fix segfault in the advanced motion model