Be more conservative about removing instanceof. Fixes issue 1032
R=blickly