Protect against null capture group value, close #1679