Raw compression fixes

Reference #1007.