Fixed lots of stuff, added a pretty halfway collision detection.
Merged.