Add new method getCurrentSorting().
Use new method getCurrentSorting().
Fix improperly encoded ids.