Update edit thread code and unit tests.