Fixed a lot of bugs, everything is working now.