Fix parts of collision detection