Fixed bug in API version selection