Fixed directory-scanning regresion. Fixed sample tests.