Corrected order of command replacements for compression subprocess