g_object_ref now returns the type of the object that was passed. Introduce cast as necessary to avoid warnings due to this.