Cleaned up some of the collision code.