Fix check for already-existing constraint