Fixes a quirk in the way matrix determinants are calculated