Handle the case of an empty string. Fixes #13401.