Added --with and improved joins to autosort both sides