Fixed bug in Collision detector