Fixed duplicate folders not being picked up

Also fxed files hashes not store into the DB