Fixed some type checking bugs regarding tuples.