The source project of this merge request has been removed.
More cleanup and bugfix (manually rebased)
The kind > last_kind
vs kind <= last_kind
patch was previously made in !6 (closed), but development continued while half that patch (the transmutes) was reverted.