Fix bug in GenericCodegen.scala leading to recursive loop.