Fix a bug in pattern matching dtype typevars