Fix bug in new fitness function