Various minor fixes to movement code.