Minor tidyup.
New tests.