Fix 413522: Improve pgm commands to be embeddable