Add some checks to build script