Fix building scripts

DO NOT MERGE YET