Adding tests and related changes.