Add more unit tests and associated functional updates.