Bug fixes in collision detection and resolution.