It seems you are passing list for the 4th argument (tuple expected) and an int for the last argument (bool expected).
Could you check these and let me know, if you could fix it?
If not, could you post a (small) executable code snippet so that we could debug easier?