selection bugfix,  tests