Fix for #870