Fixing sorting bug in ga code.