Hi again!
Well, this is stupid - I managed to forget to add a part of the shuffling system, as well as make sure the scoreboard alternatives are also purged when their team is purged.
I also added the required permission checks to ensure no ordinary player can move other players between teams.