Cast to string when comparing the versions, otherwise we were comparing numbers with strings. Also, move checks to variables. Fixes 404 errors in the version picker.