Merge bug fix from pull request #177

This commit fixes issue #194