fixed using templates with empty paths and error line reporting