Bug fixes
Merge branch 'python_smart_stats' of github.com:maxnordlund/eriver into python_smart_stats