Collision bug fixed. Code cleanup.