Fixed the collision boxes and the detection logic.