Fixed a minor issue that prevented compressing.
Added compression logic.