Made some changes to try to make using null for the player more safe.