Collision code and fixes