Bugfix: more robust selection