2 bugfixes and a minor new feature to compress the report properly

Hi,

I ran into this, while preparing to use the script at my workplace.