fix template sub-directory resolution