Various bug fixes
Update shebangs for Python 3.4 (#28)