Improved mapping for population sorting, fixed doc error