astobj2 unit test and bug fix