Fixed issues with version calculation