Fixes a sort error