Multiple fixes.. Remove global PGM. Fix some opt imports. Fix method name