Finally fixed the non-AMD case to work with external templates.