Fix parsing query.