Switched to faster isFunction implementation.