Fixes to three-tuple detection