Fixed bug in template router match.