I don't know enough about what this is doing to comment, but let me know when you've resolved it, and I'll merge this. Everything else looks good to me.