bugfix for issue #982