Consolidated some behavior into unit tests.