Fix Python 3 re-raising
Fix flake8 errors
Fix Travis failures