Updated testcases, fixed constraint bugs