Fix class_reference bug