Solved team sorting issue using an HTML trick. See comments in /teams.