Always cast the result of g_object_get_data to the proper type