Fixed some bugs with binary output in compression