Add integration tests and make them pass