critical fix and minor optimizations, new average compression rate statistic