Fix for #965