Improve capturing logic to allow more fine-grained selection.
Improve capturing logic to allow more fine-grained selection.