Replaced explicit class comparisons with 'isMemberOfClass'

Although the current comparison of classes works. I believe it is clearer and safer to use the method "-isMemberOfClass".