Fixed logic
Fixed #142
Fixed #142
Compression code