Improvements to stream handling and finding objects not listed in xref

Some objects don't seem to be listed in the xref table in some PDFs.
Also, stream handling was a little off in some cases.