-get_players_and_ratings($dbh, $season, $division, $subdivision);
-@matches = get_matches($dbh, $season, $division, $subdivision);
+my @divisions = get_divisions($dbh, $locale, $season);
+$division = $divisions[0] if (!grep { $_ == $division } @divisions);
+my @subdivisions = get_subdivisions($dbh, $locale, $season, $division);
+$subdivision = $subdivisions[0] if (!grep { $_ == $subdivision } @subdivisions);
+
+get_players_and_ratings($dbh, $locale, $season, $division, $subdivision);
+@matches = get_matches($dbh, $locale, $season, $division, $subdivision);