synchronization with C++ version
Merge branch 'master' into multidirs