Clean up write_contest().