FIXED: bug in sparse permute