Add tests for sanitizing functions and use more constrained matchers.