Various unit test improvements

SSIA.