Fixed unexpected behavior in filtering by substring