Ok, fixed a bunch of bugs.