I'll debug it a bit more over the weekend. Hopefully the solution will not be particularly involved.