Fixed an issue which caused FindCommonAncestor to use too much memory.

Fixed a bug in FindCommonAncestor that caused it to use more memory than necessary.
Made it so the BDB Graph nodes will only get the edges once.