instanceof fails when the constructor object is from a different iframe than the obj was created with. Also, the undefined check isn't helpful.