add support for limiting number of searched files
fix startPaths support on windows