Ah, sorry. The if ... instaceof ... fixed that.