Fix for issue #371