Fix pkg query with complex evaluation string