Fix query category link and column sorts