Fixed collision detection bug.