Update Buildscript

And add Rafi's changes