Fix issue #677