Fix python syntax

Fixes #15 plus a couple of minor issues.