Fix querying IDs that contain special characters.