Fix version number calculation