Fixed some bugs in player.c