Fix model completion code broken by API changes.  Thanks to @regoo for pointing this out.