Correct some error returns in SearchDoc (closes #4299, closes #4300, closes #4303)