Fix local queries