Add tests for working_copy.  Fix bugs that showed up in tests.