Corrected another bug in collision detection