Fixes #7 and minor custodial work