Fixed bug in genetic algo