Fixed collision detection.