Fixing JOIN management and fixing #1