Fix version generation for nightly builds