Fix bug in nested materialize not using the proper context relationship ID