Set environment from name correctly