Fixes in getconstrained and fixes to automatic run script