more tests & bug fixed