Fixed up permissions

Added a bunch of conditions to permissions in the case of a player
leaving or being invalid