tests & bug fixes