Adds a test for a bug if a flatMap immediately before a leftJoin produce...

...d repeated keys.  Also add's the fix. We had a bad toMap in place