Moved the order of operations around a little for typeProgram.
Removed some debug code.