Check for NULL before doing anything else
In some strange cases, lseek may return an error
Check parameters passed to paircmp()
outfp may be MULL
The debug_stream needs to be in 'inst' to be used for debugging