Python 3.4 support and related fixes