Implemented workaround for older webkit bug in Q.typeOf