Sort improvements