Fix issue #335