Fixed an issue with common code removal

Not checking which submission in the AlgorithmResults to use is dangerous.
We could get the similarity results for the common submission

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>