Fixed issue that came from the merge of the last 4 PRs.
Merge pull request #392 from marcj/master

Fixed issue that came from the merge of the last 4 PRs.