Added typeOf function.