Fix environment loading