fixed tests (were broken by last clustered-by commits)

also only apply id if not null (same with routing value)
added some more tests