Fix /. collapsing affecting parameter values

Collapsing '/:param.format' to '.format' at the end of a resource URL should only happen if the value for :param is empty and '.format' is part of the URL template. It should *not* replace '/.' sequences where the '.' comes from a parameter value.