Copy joins on duplicate layer. Fix #8243