Fixes a bug when changing the objects player.