Removed Several Bugs