Merge pull request #1 from StephaneSeyvoz/master

Fix test cases and top level component optimization