More fixes
Correctly construct subprogram
Remove debug prints