Fixed bug mentioned in issue #5