fix N1QL queries