python 3 fixes

I'm guessing there's a more "correct" way to do this than how I've fixed the __init__. Fixes #2, #3 and #4.