Update spec for readability and add tests.