Merge "Add tests to cover segments"