Add tests and fix URI and check digit bugs