Some upgrades of the collision detection