Finish line

This subsumes @rkatic’s pull request and others to get the integration tests passing. Hopefully.