Fixed a bug in genmatch, pointed by @aharisu