Merge branch 'py31_compat'

Closes #6