fixed gh-140 in first approximation
test for gh-140 added
gh-140 likely final fix