More improvements to collision detection