Fix for issue #349