Fix bug with replacing the value of a matching constant