backported a bugfix from master
Merge pull request #124 from alepore/patch-1

backported a bugfix from master