Fixing some load_environment bugs

@bellycard/platform