Fixed bug when joining a class.