plucked this out of mess of cloned repos and pull requests, things seem to work at this point and be stable.