Fixed bug in g_clear_pointer usage.