Result generation fix, table sort