Fixed broken sorting