Fix some issues with e7079762. Still support coercion through certain types of StringRegexReplace, as required for jQuery.