Fixes to three-tuple generation