Fix issue in the collision detection for compound shapes