Improve version checking