I haven't looked closely at the code, just ran it and compared the generated output. icalvalue_kind seems to have moved around a bit. The original list was not sorted. Overall though this approach works for me. I'm withdrawing my fork :)