Python 3.4 compatibility

Last changes extracted from my master branch, as I moved forward from this place.