Bugfix: undefined name in constraint generation