Improving the collision detection.