Improved Python version selection.