Fixed a bug on weasel about maxGen