tvar case in substitutability and a bug fix.