Ported over OS command length limitation fix from kepler-nightly branch.