Fixed a lot of bugs, still testing.