Properly determine version for non-rc commits on top of tags

This was doing the wrong thing in the case of a version number like
1.0.0.16, where the .16 was being completely ignored. Now we support
that correctly, just considering it an optional segment of the version
number.