Fixed tests around index selection. Fixes #223.