Fix compilation warnings
- [x] tests passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff` 
One of the fixes introduces a failing test on CI which I can't reproduce locally on either py37 or py35. Removed it for now. One more fix added. @willayd, ready.