Fix segfault in constraints