Adding a bunch of unit tests to reviews, and fixing things the unit tests exposed.