Fix a few minor bugs related to genetic engine