Fixed problems with pull request #116