Fixed upgrade script version detection.