Partially fix issue #1632