Some minor changes for Python 3 compatibility

I fixed some minor errors in code that were preventing the package to be installed in Python 3. Please, review it and, if it is ok, accept this pull request.