Fix a bug with repeated constants