Fix check constraint handling