Bug fixes around template paths