Fix external sort to play better with normal structs