SASHIMI-375 - Applied fix to output_compressed also.  Moved utility function to util.cpp.