Fix and format buildscript