Added test case to demonstrate issue #2316

Sorry it took me a while to get back to this. This test fails for me with
```TypeError: Cannot call method 'replace' of undefined```