Fix version selection bug

As mentioned in another issue, the version selector always chooses the latest version. This should fix that.