Unit tests and test utility improvements