Added tests to build script
Some minor improvements