Fix issue #781