Cleanup and fix #selectrice code.

see #220