Improved the version checker in build script.