Fix a little slowness and update build scripts