Fix remaining Python-3 issues

While retaining Python-2 compatibility.
Merge pull request #13 from saschpe/master-py3k

Fix remaining Python-3 issues