Fix various integration tests

See detailed description in each individual commit for more info.
Agree that this feels like it affects more than just the node.js entity. Maybe add a TODO to suggest a future refactoring.