Fixing syntax generation, as it was ignoring repeated sorts in the signatures.