Removing references to $team and checking GET variables are set to avoid notices