Fixed some problems with the reduce option, as well as a number of warnings from GCC.
Ignore spurious messages from OpenJPEG.