Fixed some errors in InternalState tree method and added two basic
test cases