Fix bug for tuple size greater than 22