UriTemplatePredicate cleaned up and a bug fixed