Fix wrong join parameters