fix bug with wrongly sized tuples in pattern matching