Fix Several Bugs