Add compatibility with python3.4. Fixes #2