Fix placement and order of environment setup scripts.