Fix for #346