Fixes to 3-tuple generation