Build script: more fixes