Fix crash in motion controller