multiple fixes and simplifications to constraint scripts.