Ugly, but at least it all joins up ok now.