Fixed a problem stopping a generation calculation