Bug fixes in script to build spark/shark