util: more strict check for bool/number/string