Fix prefix querying.