diff --git a/app/Module/TopSurnamesModule.php b/app/Module/TopSurnamesModule.php
index <HASH>..<HASH> 100644
--- a/app/Module/TopSurnamesModule.php
+++ b/app/Module/TopSurnamesModule.php
@@ -111,6 +111,10 @@ class TopSurnamesModule extends AbstractModule implements ModuleBlockInterface
                 ->groupBy(['surname'])
                 ->select([new Expression('n_surname /*! COLLATE utf8_bin */ AS surname'), new Expression('count(*) AS total')])
                 ->pluck('total', 'surname')
+                ->map(static function ($n): int {
+                    // Some database drivers return numeric columns strings.
+                    return (int) $n;
+                })
                 ->all();
 
             $all_surnames[$top_surname] = $variants;
Fix: #<I> - some database drivers return numeric columns as strings