Fixed Several Bugs