add test cases for ltag and stag, fixed bugs