Improve automatic version script