Fix collision detection