Fixed a class detection bug