checkfuncs.py: fix variable name error in ContractMatrix func