Removed casts in g_free(), therefore also removed some const declarations