Fixed UNIQUE constraint applying.