Fixes to movement and collision functions