Fix for issue #337