Fix for issue #861