Fix for #347

Fixes #347