More tweaks for #894, should now be more flexible with the fields it joins on and works with recursively