Fix issue #580