Extend integration tests and fix getState.