fix return value parameter order

compare_* return values in the same order as the arguments. We messed
this up in several examples.
Merge pull request #20 from tjhei/fix_chifactor_calls

fix return value parameter order