Fix query problem with locales