Fixed a few Bugs