Add integration tests
Fix bug with custom hostname