Fixed problems with pull request #63. Manual merge.