Fixes handling of sort after setData call