Ensure correct scope is used when ids is empty

We were ignoring the ids param when it was blank, causing the default
index scope to be invoked. The expected behaviour is that zero needs
are returned because none match the empty ids specified. This corrects
that.