Fix a bug: 'class' constraint not check correctly.