Prevent errors by returning immediately if no elements matched.