Change the way placeholders are selected.

Fixes #157.