updated tests, fixed constraint error handling