Fixed infinite join bug