Fix issue #3865