add small tests and fixes