Core: Use the correct function to convert strings to unsigned longs and unsigned long longs

Fixes wrong data being inserted into the database (i.e explored zones).
More info in #13493

Fixes #13493

Thanks to @jackpoz for finding the code issue and @Vavehl for an expectional bug report.