Removed some dead code relating to permutation changes
Fixed a bug where sorting in relation view used a different attribute than the one that was clicked