Sanitize pattern when no results are found

Closes #180