[Bug 849121] Fix tests. Add tests.