Build script improvements