fixing some issues in the nightly build script