Fixes sort context