Preserve table_type and table_group parameters when sorting

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Merge branch 'QA_4_1'