Fixed template selection, closes #231