Fix comparison of task_ids in test_rest