Fix sort bug in map output data.
Fix sort bugs. Now the version can be used.