Fixed a few bugs, more to fix still though