Unit test fixes.

@basepi, this needs cherry-pickin'