Fix for issue #341