Fix bug in issue #6