Improve version parsing.