Fix issue #3109

Closes #3109.