Added a normalization parameter (with tests) to the sanitize function.