Add tests and code to support them