Fixes #46 for v2
Merge pull request #48 from harikt/issue46-2

Fixes #46 for v2