Add tests and clean-up.