Added more strict warning and error checking
Added g_environ_getenv override for older versions of glib