unit tests & minor changes