issue #877 fixed as indicated in issue + test