Fix missing variable substitution in build script