Add some tests.
Fixed conflicts.