Tons of bugs fixed