Fixed unit and integration tests

These commits fix a number of issues that prevent project contributors from running the unit and integration tests, as well as integration tests that have been broken by recent commits.