Fix the build script to write the version properly