Fixed problems with uri template substitutions 'lingering'.