Update segment so you can set values on a segment. Add corresponding test cases.