Cast to correct type when calling g_setenv