[Yam] Add an error detection and update test cases