fixed bug with source dir without nested dirs. some minor corrections