Fixes collision detection.