-my $season = get_max_season($dbh);
-my @divisions = get_divisions($dbh, $season);
-$division = 1 if (!grep { $_ == $division } @divisions);
-my @subdivisions = get_subdivisions($dbh, $season, $division);
-$subdivision = 1 if (!grep { $_ == $subdivision } @subdivisions);
+my $season = wloh_common::get_max_season($dbh, $locale);
+die "Nonexistent locale!" if (!defined($season));
+
+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);