Make sure re.sub does not fail if the replacement string is None