Added check to grep to ensure only files are processed.