fix feature selection so that it works again.

Expand unit tests so that maybe next time, fails will be discovered.