fixed a couple sorting issues on tables