fix return value parameter order

compare_* return values in the same order as the arguments. We messed
this up in several examples.