Improve version handling