Fix #172, be more tolerant when generating legacy package version constraints.