Fix for #307