Fix invalid version tags

This is a potential fix for #261 
If the version tag does not match the pattern `major.minor.patch[-extensions]` the version tag will now be fixed, so semver does not throw any "Invalid version" errors.