Use g_setenv and g_getenv for portability