Fix for 108

Fixes #108. Sorry for the mess after my recent pull request. Please review and merge.