Further improvements. Integration tests working