UPDATE: Integration tests and resulting fixes