Fixed some bugs for population based selection