3.1 fixes
Merge pull request #2 from christopherdarling/master

3.1 fixes from christopherdarling