Fix player is not defined errors