The  `isBool` case can be optimized easily (indesOf is quite expensive).