Fix Python 3 support (closes #6)