Python 3 compatability

Haven't tested with Python 2, so just an FYI.