optimize isString, isNumber, isFunction; fix a reference error