What happens if you call selectMode with something falsey (I'm noticing your handling of this case at line 91)?