Added test for intersection of the words. Minor code fixes.