Bug fixes for genetic algo code