Reverted earlier changes to collision detection because of collision errors