Fixed tests build and run scripts. Added more tests.