Sort the dice.
Bugfix and minor tweaks