Improve fix for issue #4111