Fix issue #336