Djh fixes

@craigcitro I wanted to see what you thought about this before moving too far ahead. It is best digested commit-by-commit, rather than as a big diff.

I know (at the very least) I need to add some tests.