Minor improvements

All produced directory subtrees can now be one
Invalid path chars in directories, corresponding to input libraries, are now replaced to underscores.