Fixes and unit tests for ternary interaction parameters. Also, unit tests for more binary cases.