Use counts instead of values for selection logging. Fixes #436.