ol from my issue-2741 branch, fixes #80