Fix some bugs in class fragments