Fix parsing invalid url, clean up font template matching.