Omnibus of changes from fork.

This is the combination of a number of changes from my fork before @panitw added me as a contributor.