Fixed a few bugs and such