Preserve table_type and table_group parameters when sorting

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>