Previewbuildscript fixes2

Rebased and updated after mcf implementation was changed.