Applied pull request for issue #42