Fix wgt version checking logic