fix test and build scripts