Fix for env.sh files being prematurely truncated in some environments.