Fix issues with env vars not being set properly.