Added some proper integration tests.