Fix for issue #817