Properly lookup by id using the current document, fixes #16678 !strict