Fix for issue #102

(reverted part of pull request #92, sorry @jacob-baines feel free to push again if you find a better approach)