Fixes sort issues