Fixes merge conflicts for issue #346 (pull request #347)

This will replace merge request #347 that fixes issue #346.