Increase max_result. Allow grep when no open files. Clean tmpfile references.
Merge