test case + bug fix for sorting
more test cases for transforms & bug fixes

... to treat stats & transforms differently