Merge "Fix the missing history event problem." into tm-dev