fixed bug for small populations sizes