Test fixes

This PR includes some fixes I found while writing tests in the integration test project.