Tests and fix for class toggling

@winhamwr here is a no selection test.