Improved file/dir filtering in generate step

That way, we will ignore directories which usually trigger permission denied errors.
fixes #31