Merge "Check task switch by comparing leaf task." into tm-dev