Fix and close issue #158