I don't know if there still interest on this, I'm sending here a fixed and updated version of this patch. This is ready to merge into master (unless there is something else).