Fixed bug in getconstrained and merged functionality from db2atlas into extractsm.py