Fixed a bug in gene generation.