[[ Bug 10986 ]] Make sure we only select an object if 'before/after' is not specified.
Merge branch 'bugfix-10966' into develop