Add tests from Nick Coghlan