Fix runtime sort error