Program: 86124
Project: 86124
Buggy source:
/** 
 * Leaves the current arena, won't do anything if not present in any arena
 * @param playername
 * @param fullLeave Determines if player left only minigame or the server
 */
public void leavePlayer(String playername,boolean fullLeave){
  if (!this.containsPlayer(playername)) {
    return;
  }
  this.players.remove(playername);
  MinigamesAPI.getAPI().pinstances.get(plugin).global_players.remove(playername);
  if (fullLeave) {
    return;
  }
  final Player p=Bukkit.getPlayer(playername);
  Util.clearInv(p);
  p.getInventory().setContents(pinv.get(playername));
  p.getInventory().setArmorContents(pinv_armor.get(playername));
  p.updateInventory();
  p.setWalkSpeed(0.2F);
  MinigamesAPI.getAPI().pinstances.get(plugin).getRewardsInstance().giveReward(playername);
  MinigamesAPI.getAPI().pinstances.get(plugin).global_players.remove(playername);
  if (MinigamesAPI.getAPI().pinstances.get(plugin).global_lost.containsKey(playername)) {
    MinigamesAPI.getAPI().pinstances.get(plugin).global_lost.remove(playername);
  }
  final String arenaname=this.getName();
  Util.teleportPlayerFixed(p,this.mainlobby);
  Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
    public void run(){
      p.setFlying(false);
      if (!p.isOp()) {
        p.setAllowFlight(false);
      }
      if (pgamemode.containsKey(p.getName())) {
        p.setGameMode(pgamemode.get(p.getName()));
      }
      try {
        MinigamesAPI.getAPI().pinstances.get(plugin).scoreboardManager.removeScoreboard(arenaname,p);
      }
 catch (      Exception e) {
      }
    }
  }
,5L);
  if (this.getAllPlayers().size() < 2) {
    this.stop();
  }
}

Fixed version (ground truth):
/** 
 * Leaves the current arena, won't do anything if not present in any arena
 * @param playername
 * @param fullLeave Determines if player left only minigame or the server
 */
public void leavePlayer(String playername,boolean fullLeave){
  if (!this.containsPlayer(playername)) {
    return;
  }
  this.players.remove(playername);
  MinigamesAPI.getAPI().pinstances.get(plugin).global_players.remove(playername);
  if (fullLeave) {
    return;
  }
  final Player p=Bukkit.getPlayer(playername);
  Util.clearInv(p);
  p.getInventory().setContents(pinv.get(playername));
  p.getInventory().setArmorContents(pinv_armor.get(playername));
  p.updateInventory();
  p.setWalkSpeed(0.2F);
  p.removePotionEffect(PotionEffectType.JUMP);
  MinigamesAPI.getAPI().pinstances.get(plugin).getRewardsInstance().giveReward(playername);
  MinigamesAPI.getAPI().pinstances.get(plugin).global_players.remove(playername);
  if (MinigamesAPI.getAPI().pinstances.get(plugin).global_lost.containsKey(playername)) {
    MinigamesAPI.getAPI().pinstances.get(plugin).global_lost.remove(playername);
  }
  final String arenaname=this.getName();
  Util.teleportPlayerFixed(p,this.mainlobby);
  Bukkit.getScheduler().runTaskLater(plugin,new Runnable(){
    public void run(){
      p.setFlying(false);
      if (!p.isOp()) {
        p.setAllowFlight(false);
      }
      if (pgamemode.containsKey(p.getName())) {
        p.setGameMode(pgamemode.get(p.getName()));
      }
      try {
        MinigamesAPI.getAPI().pinstances.get(plugin).scoreboardManager.removeScoreboard(arenaname,p);
      }
 catch (      Exception e) {
      }
    }
  }
,5L);
  if (this.getAllPlayers().size() < 2) {
    this.stop();
  }
}