fix logic errors in constraint generator for Tuple