Fixed isTextItem method by using Cocoa variant.