Revert "Merge pull request #1744 from doxxx/issue-1313"

Reverted commit reintroduced issue #1092.

This reverts commit d445ae4421cc54aa20902595077a861147e91925, reversing
changes made to ee60786fe48c8ce36dbb3ef51d8743af41fc020f.