Collisions and bug fixes

Improved collision handling and removed a flaw in the physics simulation