fix candidates and elements selections

Replaces #184 and #183