Well, there was no bug; the program was operating as designed.
The problem was that the random access algorithm was not fully correct. I've thought more and concluded that there is no correct random access algorithm that doesn't require as much scanning as a 2-pass solution.
Therefore, I have implemented the 2-pass solution and tested it locally. Note that the second pass is very fast as there is no calculation involved or frame processing involved. 'manono' will be doing some additional testing and then I'll release it here. It seems to work well on his funny-money silent films that have weird duplicate patterns, like 43 out of every 143 frames!
The use of two passes allows for the insertion of a (GUI) application that permits manual tweaking of the decimation decisions, if desired. It also allows for totally random decimation, such as "remove all combed frames in the clip" (because the correct frame count is known before the second pass begins).