Fixed template caching.
Fixed path sorting.