Fixed Collision detection and a few other bugs.