Fix report generator

@hugovk you mind that I took the ideas from your PR rather than asking you to make changes? If you like I can remove 72dba22 and have you make a separate PR.

The changes here should address the issue your recent PR brought up. The TOX should now be running your test and now it passes.