Improved collision detection system, fixed some special cases where ramps would not work correctly.