Add fix and test for bug where selector is ignored for capturing events

Refer to https://gist.github.com/mquandalle/8157017