make C and Java tests pass and update their code