Fix some environment loading.