Fix to init g_system as NULL in error case