Fixed some dangerous bugs in the scoreboard