Fixed some bugs where IE didn't handle instanceof like Firefox and Chrome