Fixed instance class detection