Use `totpoly` instead of `totface`. The original code was written for non-bmesh case and likely missed this update.