REP-997 Added test and check of uri to make sure it is valid.