Fix for issue #597